# -*- coding:UTF-8 -*-
'''
Created on 2012-7-5
对象序列化
@author: Administrator
'''
import cPickle as p

shoplistfile = 'shoplist.data'

shoplist = ['apple', 'mango', 'carrot']

# Write Object to the file
f = file(shoplistfile, 'w')
p.dump(shoplist, f)
f.close()

del shoplist

# Read back from the storage
f = file(shoplistfile, 'r')
storedlist = p.load(f)
print type(storedlist)